package com.hulizuofang.wol.chat.client.view;

import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
import com.google.inject.Inject;
import com.hulizuofang.wol.chat.client.gin.ClientI18nMessages;
import com.hulizuofang.wol.chat.client.presenter.StartPagePresenter.PageView;
import com.hulizuofang.wol.chat.client.ui.chat.SetLoginPanel;
import com.hulizuofang.wol.chat.client.ui.event.setlogin.SetLoginHandler;

public class StartPageViewImpl extends Composite implements PageView {
	private AbsolutePanel container;
	private final SetLoginPanel setLoginPanel;
	private final ClientI18nMessages i18n;

	@Inject
	public StartPageViewImpl(ClientI18nMessages i18n, SetLoginPanel setLoginPanel) {
		this.i18n = i18n;
		this.setLoginPanel = setLoginPanel;
		container = new AbsolutePanel();	
		initWidget(container);
	}
	
	@Override
	protected void onLoad() {
		container.add(new Label(i18n.welcome()));
		container.add(setLoginPanel);		
	}
	
	@Override
	public void addSetLoginHandler(SetLoginHandler handler) {
		setLoginPanel.addSetLoginHandler(handler);
	}

	@Override
	public void addToSlot(Object slot, Widget content) {
	}

	@Override
	public void removeFromSlot(Object slot, Widget content) {
	}

	@Override
	public void setInSlot(Object slot, Widget content) {
	}

}
